<template>
  <div class="hello">
    <h2>我是首页</h2>
    <ul>
      <li v-for="item in tableData" :key="item.t_plant_pk">{{item.plant_name}}</li>
    </ul>
  </div>
</template>

<script lang="ts">

import { Options,Vue } from "vue-class-component";

import axios from "axios";

@Options({
  data() {
    return {
      tableData: [],
    };
  },
  created() {
    var that = this;
    axios({
      url: "https://www.forerunnercollege.com/soApi/plant/queryList",
      data: {t_cat_pk: 5},
      method: "post"
    }).then(res => {
      console.log("this = ",this);
      that.tableData = res.data.result_data;
    })
  }
})

export default class HelloWorld extends Vue {
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss">
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
